import React,{Component} from 'react';
import { Layout,Menu } from 'antd';
import { BrowserRouter as Router,Route,Link } from "react-router-dom";

const {
    Header
} = Layout;

class Head extends Component {
    constructor(props){
        super(props);
        this.state = {
            urlpath : [this.props.urlpath]
        }
    }

    render(){
        return(
            <div>
                <Layout>
                    <Header>
                        <Menu
                            theme="dark"
                            mode="horizontal"
                            defaultSelectedKeys = {this.state.urlpath}
                            style={{ lineHeight: '64px' }}
                        >
                            <Menu.Item key="/in"><Link to="/in">入库</Link></Menu.Item>
                            <Menu.Item key="/out"><Link to="/out">出库</Link></Menu.Item>
                            <Menu.Item key="/record"><Link to="/record">出入库记录</Link></Menu.Item>
                            <Menu.Item key="/product"><Link to="/product">商品信息</Link></Menu.Item>
                        </Menu>
                    </Header>
                </Layout>

            </div>
        );
    }
}

export default Head;